<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of EmailDAOClass
 *
 * @author Gustavo
 */
include_once 'ConfigClass.php';
include_once '../negocios/EmailClass.php';
class EmailDAOClass {
    private $conn;

    public function  __construct() {
        $this->conn = new ConfigClass();
    }

    public function  __destruct() {

    }

    public function cadastraMail(EmailClass $email, UsuarioDAOClass $usuario){
        $this->conn->conecta();

        $usuario = $usuario->get_Id_usuario($login);
        $query = "INSERT INTO email (email, id_usuario)VALUES('".$email->getEmail()."','$usuario')";
        $res = pg_query($query);

        $this->conn->desconecta();
    }
}
?>
